﻿<UserControl x:Class="SharePointCommander.SCTreeView" 
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
             xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
             xmlns:local="clr-namespace:SharePointCommander"
             mc:Ignorable="d" 
             d:DesignHeight="300" d:DesignWidth="300">
    <TreeView x:Name="TreeView" Margin="0,0,0,0" Grid.Column="0" ItemsSource="{Binding}">
        <TreeView.Resources>
            <Style TargetType="{x:Type TreeViewItem}">
                <Setter Property="HeaderTemplate">
                    <Setter.Value>
                        <DataTemplate>
                            <StackPanel Orientation="Horizontal">
                                <TextBlock Text="{Binding}" Margin="0,0" VerticalAlignment="Center" />
                            </StackPanel>
                        </DataTemplate>
                    </Setter.Value>
                </Setter>
            </Style>
            <Style TargetType="{x:Type local:Model.TreeView.SCFarm}">
                <Setter Property="HeaderTemplate">
                    <Setter.Value>
                        <DataTemplate>
                            <StackPanel Orientation="Horizontal">
                                <Image Name="img" Width="16" Height="16" Stretch="Fill" Source="Images/farm.png"/>
                                <TextBlock Text="{Binding}" Margin="5,0" VerticalAlignment="Center" />
                            </StackPanel>
                        </DataTemplate>
                    </Setter.Value>
                </Setter>
            </Style>
            <Style TargetType="{x:Type local:Model.TreeView.SCSolutionCollection}">
                <Setter Property="HeaderTemplate">
                    <Setter.Value>
                        <DataTemplate>
                            <StackPanel Orientation="Horizontal">
                                <Image Name="img" Width="16" Height="16" Stretch="Fill" Source="Images/solutionactivate.png"/>
                                <TextBlock Text="{Binding}" Margin="5,0" VerticalAlignment="Center" />
                            </StackPanel>
                        </DataTemplate>
                    </Setter.Value>
                </Setter>
            </Style>
            <Style TargetType="{x:Type local:Model.TreeView.SCSolution}">
                <Style.Triggers>
                    <Trigger Property="Deployed" Value="True">
                        <Setter Property="HeaderTemplate">
                            <Setter.Value>
                                <DataTemplate>
                                    <StackPanel Orientation="Horizontal">
                                        <Image Name="img" Width="16" Height="16" Stretch="Fill" Source="Images/solutionactivate.png"/>
                                        <TextBlock Text="{Binding}" Margin="5,0" VerticalAlignment="Center" />
                                    </StackPanel>
                                </DataTemplate>
                            </Setter.Value>
                        </Setter>
                    </Trigger>
                    <Trigger Property="Deployed" Value="False">
                        <Setter Property="HeaderTemplate">
                            <Setter.Value>
                                <DataTemplate>
                                    <StackPanel Orientation="Horizontal">
                                        <Image Name="img" Width="16" Height="16" Stretch="Fill" Source="Images/solutiondeactivate.png"/>
                                        <TextBlock Text="{Binding}" Margin="5,0" VerticalAlignment="Center" />
                                    </StackPanel>
                                </DataTemplate>
                            </Setter.Value>
                        </Setter>
                    </Trigger>
                </Style.Triggers>
            </Style>
            <Style TargetType="{x:Type local:Model.TreeView.SCServerCollection}">
                <Setter Property="HeaderTemplate">
                    <Setter.Value>
                        <DataTemplate>
                            <StackPanel Orientation="Horizontal">
                                <Image Name="img" Width="16" Height="16" Stretch="Fill" Source="Images/server.png"/>
                                <TextBlock Text="{Binding}" Margin="5,0" VerticalAlignment="Center" />
                            </StackPanel>
                        </DataTemplate>
                    </Setter.Value>
                </Setter>
            </Style>
            <Style TargetType="{x:Type local:Model.TreeView.SCServer}">
                <Setter Property="HeaderTemplate">
                    <Setter.Value>
                        <DataTemplate>
                            <StackPanel Orientation="Horizontal">
                                <Image Name="img" Width="16" Height="16" Stretch="Fill" Source="Images/server.png"/>
                                <TextBlock Text="{Binding}" Margin="5,0" VerticalAlignment="Center" />
                            </StackPanel>
                        </DataTemplate>
                    </Setter.Value>
                </Setter>
            </Style>
            <Style TargetType="{x:Type local:Model.TreeView.SCServiceCollection}">
                <Setter Property="HeaderTemplate">
                    <Setter.Value>
                        <DataTemplate>
                            <StackPanel Orientation="Horizontal">
                                <Image Name="img" Width="16" Height="16" Stretch="Fill" Source="Images/service.png"/>
                                <TextBlock Text="{Binding}" Margin="5,0" VerticalAlignment="Center" />
                            </StackPanel>
                        </DataTemplate>
                    </Setter.Value>
                </Setter>
            </Style>
            <Style TargetType="{x:Type local:Model.TreeView.SCService}">
                <Setter Property="HeaderTemplate">
                    <Setter.Value>
                        <DataTemplate>
                            <StackPanel Orientation="Horizontal">
                                <Image Name="img" Width="16" Height="16" Stretch="Fill" Source="Images/service.png"/>
                                <TextBlock Text="{Binding}" Margin="5,0" VerticalAlignment="Center" />
                            </StackPanel>
                        </DataTemplate>
                    </Setter.Value>
                </Setter>
            </Style>
            <Style TargetType="{x:Type local:Model.TreeView.SCServiceApplication}">
                <Setter Property="HeaderTemplate">
                    <Setter.Value>
                        <DataTemplate>
                            <StackPanel Orientation="Horizontal">
                                <Image Name="img" Width="16" Height="16" Stretch="Fill" Source="Images/serviceapplication.png"/>
                                <TextBlock Text="{Binding}" Margin="5,0" VerticalAlignment="Center" />
                            </StackPanel>
                        </DataTemplate>
                    </Setter.Value>
                </Setter>
            </Style>
            <Style TargetType="{x:Type local:Model.TreeView.SCServiceInstanceCollection}">
                <Setter Property="HeaderTemplate">
                    <Setter.Value>
                        <DataTemplate>
                            <StackPanel Orientation="Horizontal">
                                <Image Name="img" Width="16" Height="16" Stretch="Fill" Source="Images/service.png"/>
                                <TextBlock Text="{Binding}" Margin="5,0" VerticalAlignment="Center" />
                            </StackPanel>
                        </DataTemplate>
                    </Setter.Value>
                </Setter>
            </Style>
            <Style TargetType="{x:Type local:Model.TreeView.SCServiceInstanceDependencyCollection}">
                <Setter Property="HeaderTemplate">
                    <Setter.Value>
                        <DataTemplate>
                            <StackPanel Orientation="Horizontal">
                                <Image Name="img" Width="16" Height="16" Stretch="Fill" Source="Images/service.png"/>
                                <TextBlock Text="{Binding}" Margin="5,0" VerticalAlignment="Center" />
                            </StackPanel>
                        </DataTemplate>
                    </Setter.Value>
                </Setter>
            </Style>
            <Style TargetType="{x:Type local:Model.TreeView.SCServiceInstance}">
                <Setter Property="HeaderTemplate">
                    <Setter.Value>
                        <DataTemplate>
                            <StackPanel Orientation="Horizontal">
                                <Image Name="img" Width="16" Height="16" Stretch="Fill" Source="Images/service.png"/>
                                <TextBlock Text="{Binding}" Margin="5,0" VerticalAlignment="Center" />
                            </StackPanel>
                        </DataTemplate>
                    </Setter.Value>
                </Setter>
            </Style>
            <Style TargetType="{x:Type local:Model.TreeView.SCWebService}">
                <Setter Property="HeaderTemplate">
                    <Setter.Value>
                        <DataTemplate>
                            <StackPanel Orientation="Horizontal">
                                <Image Name="img" Width="16" Height="16" Stretch="Fill" Source="Images/service.png"/>
                                <TextBlock Text="{Binding}" Margin="5,0" VerticalAlignment="Center" />
                            </StackPanel>
                        </DataTemplate>
                    </Setter.Value>
                </Setter>
            </Style>
            <Style TargetType="{x:Type local:Model.TreeView.SCWebApplication}">
                <Setter Property="HeaderTemplate">
                    <Setter.Value>
                        <DataTemplate>
                            <StackPanel Orientation="Horizontal">
                                <Image Name="img" Width="16" Height="16" Stretch="Fill" Source="Images/webapplication.png"/>
                                <TextBlock Text="{Binding}" Margin="5,0" VerticalAlignment="Center" />
                            </StackPanel>
                        </DataTemplate>
                    </Setter.Value>
                </Setter>
            </Style>
            <Style TargetType="{x:Type local:Model.TreeView.SCApplicationPool}">
                <Setter Property="HeaderTemplate">
                    <Setter.Value>
                        <DataTemplate>
                            <StackPanel Orientation="Horizontal">
                                <Image Name="img" Width="16" Height="16" Stretch="Fill" Source="Images/components.gif"/>
                                <TextBlock Text="{Binding}" Margin="5,0" VerticalAlignment="Center" />
                            </StackPanel>
                        </DataTemplate>
                    </Setter.Value>
                </Setter>
            </Style>
            <Style TargetType="{x:Type local:Model.TreeView.SCContentDatabaseCollection}">
                <Setter Property="HeaderTemplate">
                    <Setter.Value>
                        <DataTemplate>
                            <StackPanel Orientation="Horizontal">
                                <Image Name="img" Width="16" Height="16" Stretch="Fill" Source="Images/databases.png"/>
                                <TextBlock Text="{Binding}" Margin="5,0" VerticalAlignment="Center" />
                            </StackPanel>
                        </DataTemplate>
                    </Setter.Value>
                </Setter>
            </Style>
            <Style TargetType="{x:Type local:Model.TreeView.SCContentDatabase}">
                <Setter Property="HeaderTemplate">
                    <Setter.Value>
                        <DataTemplate>
                            <StackPanel Orientation="Horizontal">
                                <Image Name="img" Width="16" Height="16" Stretch="Fill" Source="Images/datasource.gif"/>
                                <TextBlock Text="{Binding}" Margin="5,0" VerticalAlignment="Center" />
                            </StackPanel>
                        </DataTemplate>
                    </Setter.Value>
                </Setter>
            </Style>
            <Style TargetType="{x:Type local:Model.TreeView.SCSiteCollection}">
                <Setter Property="HeaderTemplate">
                    <Setter.Value>
                        <DataTemplate>
                            <StackPanel Orientation="Horizontal">
                                <Image Name="img" Width="16" Height="16" Stretch="Fill" Source="Images/sitecollection.png"/>
                                <TextBlock Text="{Binding}" Margin="5,0" VerticalAlignment="Center" />
                            </StackPanel>
                        </DataTemplate>
                    </Setter.Value>
                </Setter>
            </Style>
            <Style TargetType="{x:Type local:Model.TreeView.SCSite}">
                <Setter Property="HeaderTemplate">
                    <Setter.Value>
                        <DataTemplate>
                            <StackPanel Orientation="Horizontal">
                                <Image Name="img" Width="16" Height="16" Stretch="Fill" Source="Images/sitecollection.png"/>
                                <TextBlock Text="{Binding}" Margin="5,0" VerticalAlignment="Center" />
                            </StackPanel>
                        </DataTemplate>
                    </Setter.Value>
                </Setter>
            </Style>
            <Style TargetType="{x:Type local:Model.TreeView.SCWeb}">
                <Setter Property="HeaderTemplate">
                    <Setter.Value>
                        <DataTemplate>
                            <StackPanel Orientation="Horizontal">
                                <Image Name="img" Width="16" Height="16" Stretch="Fill" Source="Images/web.png"/>
                                <TextBlock Text="{Binding}" Margin="5,0" VerticalAlignment="Center" />
                            </StackPanel>
                        </DataTemplate>
                    </Setter.Value>
                </Setter>
            </Style>
            <Style TargetType="{x:Type local:Model.TreeView.SCList}">
                <Setter Property="HeaderTemplate">
                    <Setter.Value>
                        <DataTemplate>
                            <StackPanel Orientation="Horizontal">
                                <Image Name="img" Width="16" Height="16" Stretch="Fill" Source="Images/list.png"/>
                                <TextBlock Text="{Binding}" Margin="5,0" VerticalAlignment="Center" />
                            </StackPanel>
                        </DataTemplate>
                    </Setter.Value>
                </Setter>
            </Style>
            <Style TargetType="{x:Type local:Model.TreeView.SCProperties}">
                <Setter Property="HeaderTemplate">
                    <Setter.Value>
                        <DataTemplate>
                            <StackPanel Orientation="Horizontal">
                                <Image Name="img" Width="16" Height="16" Stretch="Fill" Source="Images/properties.png"/>
                                <TextBlock Text="{Binding}" Margin="5,0" VerticalAlignment="Center" />
                            </StackPanel>
                        </DataTemplate>
                    </Setter.Value>
                </Setter>
            </Style>
        </TreeView.Resources>
    </TreeView>
</UserControl>
